package org.starlight.user.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.starlight.user.entity.Dept;
import org.starlight.user.serivce.DeptService;

/**
 * 部门服务
 *
 * @author huangyong
 * @data 2025/2/28
 */
@Tag(name = "部门服务", description = "部门服务")
@RestController
@RequiredArgsConstructor
@RequestMapping("/dept")
public class DeptController {
    private final DeptService deptService;

    @Operation(summary = "保存部门")
    @ResponseStatus(HttpStatus.OK)
    @PostMapping
    public void save(Dept dept) {
        deptService.save(dept);
    }

    @Operation(summary = "删除部门")
    @ResponseStatus(HttpStatus.OK)
    @GetMapping("/{id}")
    public void del(@PathVariable Integer id) {
        deptService.del(id);
    }
}
